<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>

<body>
  <!-- 
    v-for遍历对象
      <div v-for="(value,key,index) in Object"></div>
    
    v-if v-for结合
      <div v-if="value===18" v-for="(value,key,index) in Object"></div>
      满足特定的条件才渲染
   -->
  <div id="app">
    <div v-for="(value,key,index) in obj">{{value+" === "+key+" === "+index}}</div>
    <div v-if="value===18" v-for="(value,key,index) in obj" :key="index">{{value+" === "+key+" === "+index}}</div>
  </div>
  <script src="../js/vue.js"></script>
  <script>
    const vm = new Vue({
      el: "#app",
      data: {
        obj: {
          uname: "cz",
          age: 18,
          gender: "男"
        }
      },
      methods: {}
    });
  </script>
</body>

</html>
